home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / graphics / 3dvect37.zip / README.DOC < prev    next >
Text File  |  1994-06-22  |  39KB  |  747 lines

  1.  
  2.                           3d Vectors Source 3.7
  3.  
  4.                         Smart Kids Don't Do Drugs!
  5.  
  6.    Date of release - June 22/94
  7.  
  8.    Written by: John McCarthy
  9.                1316 Redwood Lane
  10.                Pickering, Ontario.
  11.                Canada, Earth, Milky Way (for those out-of-towners)
  12.                L1X 1C5
  13.  
  14.    Internet/Usenet:  BRIAN.MCCARTHY@CANREM.COM
  15.            Fidonet:  Brian McCarthy 1:229/15
  16.      RIME/Relaynet: ->CRS
  17.  
  18.    This internet address will be canceled in Sept/94
  19.  
  20.    Home phone,(905)831-1944, always willing to talk but don't call at 2 am eh!
  21.  
  22.    God, this package is getting big...
  23.  
  24.    Routines to be used by all for anything, just send me  a  copy  of  what
  25.    you've accomplished (final product), or at least send me a postcard from
  26.    someplace near where you live.
  27.  
  28.    Many thanks to: Razor - for providing source for their demo.  This  gave
  29.                    me the idea of how to draw polygons in the first place.
  30.  
  31.                    Mode X routines - Matt Pritchard
  32.  
  33.                    Protected Mode Header - Tran
  34.  
  35.                    Bitmap X-mode Scaling routine - John A. Slagel
  36.  
  37.                    Technical support - Robin Ward
  38.                    (in no defined      Danny Hawrysio
  39.                        order)          Robert Johnston
  40.                                        Ciaran Gultniers
  41.                                        Mark Rosteck
  42.                                        Shawn Knight
  43.                                        Sebastian Dwornik
  44.                                        Adam Kurzawa
  45.                                        Adam Johns
  46.                                        Ciaus Tenche
  47.                                        Peter Gruhn
  48.                                        Sean Palmer
  49.                                        Alan Illeman
  50.                                        Rich Geldreich
  51.                                        Peter Hinz
  52.  
  53.                    Food provided by - My Mommy
  54.  
  55.   As noted above, this file would not  be  possible  without  other  people
  56.   giving away their source code.  I continue the tradition of "knowledge is
  57.   power" and give this away.  Most people who see this will never do a damn
  58.   thing with it but look at it and say "uh, so, what next?" so I don't want
  59.   you to register or anything dumb like that.  By the way, people who  want
  60.   money for crappy shareware progs can rot in hell.  But if you do  make  a
  61.   commercial game, and make billions, at least  send  me  a  postcard  from
  62.   the Bahamas ok!  Like I'm not going  to   refuse  a  cheque if  you  make
  63.   something commercial, but like I said, only 1 in a million  may  actually
  64.   have the time/effort/patience/guts/brains to make a commercial game.
  65.  
  66.   If you can't get it to assemble:
  67.    1) Make sure you are using TASMX.EXE, not TASM.EXE! (out of memory)
  68.    2) You will notice that the linker referances the directory \32\    This
  69.       is where I have all my generic protected mode stuff. Every programmer
  70.       should have a directory with protected mode code in it. Begin today!
  71.  
  72.   The original Mode X routines have been  modified   to  support  protected
  73.   mode.  Many thanks Matt Pritchard for the X-Mode knowledge.  I  hope  you
  74.   don't mind my changing your routines.  Matt Pritchard can be  reached  at
  75.   P.O. Box 140264, Irving, TX  75014  USA.
  76.  
  77.   The protected mode header has been supplied by TRAN and can be reached on
  78.   Sound Barrier BBS (718)979-6629.  I have included all of TRANs  protected
  79.   mode package because I really hate getting code from  someplace  and  not
  80.   getting the support for it.  I make no claim  to  any  of  this  code,  I
  81.   simply want to supply you with all the info to effectively work with this
  82.   3d vector package.  TRAN implies that you can reach him  on  internet  at
  83.   tran@phantom.com
  84.  
  85.   The bitmap scale routine has been supplied by John A. Slagel.  Thanks  to
  86.   you as  well  where  ever  you  are.   The  scale  routine  now  supports
  87.   transparent bitmapping.  As of this writing, John  A.  Slagel's  internet
  88.   access has been canceled and I have no other address for him.
  89.  
  90.   If you want the original non-protected mode Vector  routines, I  can  dig
  91.   them up for you if you send me a  disk  or  something.   But  first,  ask
  92.   yourself, "Why would anyone want to  go back to  segmented  coding?"   If
  93.   you still want those  routines, hit  self  on  head  with  nearest  blunt
  94.   object and re-ask question.  (Many thanks TRAN)
  95.  
  96.   Routines are heavily optimized for 3d  vectors.   Any  code/routine  that
  97.   slow is not intended to be used with animation and has  been  written  to
  98.   simply get the job done.  You will know which routines are slow/fast once
  99.   you look at the code.
  100.  
  101.   I don't apologize for the lack  of  effective  documentation  or  example
  102.   programs as this code was written for my own use.  I would like to  spend
  103.   more time writing code than writing docs.  I also don't apologize for the
  104.   lack of universality of code execution.  For example, Matts xmode code is
  105.   callable from C but mine isn't.  Some of the routines must have registers
  106.   set up before entry and some require memory to be set up.  U figure which
  107.   is which.  It usually says at the begining of the routine.   Once  again,
  108.   making  everything callable from C slows things down  and  this is what I
  109.   wanted to avoid.  Speed is the key considering it is for my own use.
  110.  
  111.   You must have a 386 to run this.  If you only have a 286, get a  job  and
  112.   buy a real machine!
  113.  
  114.   Also, I really hate people who give away their "source" code but actually
  115.   only give away the object file.  If these people are so embarassed  about
  116.   their crappy code then we don't want your crappy object file.  Give  away
  117.   all or nothing.
  118.  
  119.   It would be really nice if I got a postcard from some place near where you
  120.   live.
  121.  
  122.     Some files in this zip:
  123.  
  124.       main.asm      ; example program to show vectors
  125.       3d1.asm       ; 3d vector routines by John McCarthy, fast sort method
  126.       3d2.asm       ; 3d vector routines by John McCarthy, full sort method
  127.       3d3.asm       ; 3d vector routines by John McCarthy, tolerenced sort method
  128.       xmode.asm     ; xmode routines by Matt Pritchard
  129.       xmouse.asm    ; xmode/protected mode mouse routines
  130.       pmode.asm     ; protected mode routines by TRAN
  131.       file.asm      ; pmode file routines by TRAN
  132.       argc.asm      ; command line argument scanner by TRAN
  133.       stars.asm     ; plot stars
  134.       font.asm      ; screen setup routines
  135.  
  136.       xmode.inc     ; files defining externals for linkage
  137.       xmouse.inc    ; with above asm files
  138.       pmode.inc     ; example: if you want to use some routines/data
  139.       3d.inc        ; from xmode.asm, use:include xmode.inc
  140.       file.inc
  141.       argc.inc
  142.       stars.inc
  143.       font.inc
  144.  
  145.       xscale.inc    ; bitmap scaling routines
  146.       poly.inc      ; common 3d vector routines between 3d1,3d2 & 3d3
  147.       math.inc      ; math functions for 3d.asm
  148.       sin.inc       ; data tables for math functions: math.inc
  149.       arctan.inc    ; inverse tan function tables: math.inc
  150.       vars1/2.inc   ; variables for 3d.asm routine
  151.       equ.inc       ; list of constants
  152.  
  153.       macros.inc    ; macros used throughout
  154.  
  155.       qb.zip        ; qb quickbasic programs to generate sin and arctan tables
  156.       modex104.zip  ; (some of the) original files from Matt's modex104.zip
  157.  
  158.       stone?.inc    ; shaded stone textures
  159.  
  160.   Some bugs fixed for 2.1:
  161.  
  162.     Mouse routine draw_bitmap fixed (start of bitmap is x and y). Fixes crash
  163.  
  164.     Also, the mouse resolution has been divided by two to stop that dang  two
  165.     pixel movement!
  166.  
  167.     Many bugs fixed in Xmode.asm conversion from segmented mode to protected
  168.     mode.  Too many protected mode bug fixes to list.
  169.  
  170.     Also added some palette fading routines to xmode.asm
  171.  
  172.     The big change is the new method of  sorting  surfaces.   Before,  objects
  173.     were sorted first, then surfaces within objects were sorted.  Now, drawing
  174.     an object simply draws the surfaces in   memory   and  then  ALL  surfaces
  175.     are sorted as a group.  This now allows small objects to go inside  larger
  176.     objects.  This is not possible in 3d1,  small objects will disappear.  The
  177.     3d1 file is faster but the 3d2 file has greater flexability with  objects.
  178.     The old file is 3d1.asm while the full sorting file  is  3d2.asm.  To  use
  179.     you must call sort_list and drawvect after makeobjs (if using  3d2  -  the
  180.     full sort method).  See main1 and main2 for examples.   To  give  you  the
  181.     speed difference between the two, the calculation for a   bubble  sort  is
  182.     (n^2+n)/2 for number of times routine will sort.  In 3d1 - 30 objects with
  183.     30 sides will take 465 sorts * 30 objects + 465 to sort those  objects  is
  184.     =  14,415  loops.   But  3d2  uses  the  basic  30*30  sorts.   Therefore,
  185.     (900^2+900)/2 = 405,450 loops!  You can use 3d2 in portions and still  get
  186.     the speed of 3d1 if you know certain objects will be far or near (eg  land
  187.     scapes and stars are always far) and this can provide you with  the  speed
  188.     and versatility of objects going inside one another.  The only  difference
  189.     between 3d1 and 3d2 is the sort method - full objects then surfaces (3d1),
  190.     or all surfaces together (3d2).
  191.  
  192.     Also made it possible to now have points (single dots) and  bitmaps  as
  193.     part of an object.  You no longer need to make a bitmap it's own object
  194.     but can now have it as part of another object.  It is still possible to
  195.     have bitmaps as their own objects (for explosions and bullets).     See
  196.     sphered cube and regular sphere in example file.
  197.  
  198.   Optimizations for 3dvect22:
  199.  
  200.     Better make1obj routine  now  uses  ematrix  more  efficiently  by  only
  201.     calculating matrix x,y and z as needed - makes better use  of  cpu  time
  202.     when there are many objects off screen (behind camera or too far lft/rgt
  203.     up/dwn)
  204.  
  205.     Added more math functions
  206.  
  207.     Optimized erotate when usez = no
  208.  
  209.   Changes for 3dvect23:  Aug 10/93
  210.  
  211.     Implemented new pmode.asm code by TRAN.  This replaces the  start32  code
  212.     and allows 3dvect to be run with memory managers like HIMEM  and  EMM386.
  213.     Many thanks to TRAN!  Note: Maximum speed is still found with  no  memory
  214.     managers - ie. raw memory.  Change all int 30h's to int 33h's.
  215.  
  216.     Removed some common routines from 3d1 and 3d2 and put them in poly.inc to
  217.     avoid duplicate copies of routines.
  218.  
  219.     Also added to xmode.asm routines to turn off the screen to stop flicker
  220.     when changing into xmode
  221.  
  222.     I am currently writing this from my living room floor where I  have  been
  223.     laying for the last month due to a herniated disc in my lower back - fun!
  224.  
  225.   Additions for 3dvect24:  Aug 29/93
  226.  
  227.     The main addition for version 2.4 is the IRQ  routine  that  co-ordinates
  228.     itself  with  the  routine  updvectors.   The  IRQ  increments  the  byte
  229.     traces_past every time a vertical retrace occures  (regardless  of   what
  230.     the vector routines are doing) and the routine updvectors (get it, up the
  231.     vectors - d=the, like the poor people say) anyway, updvectors  uses  this
  232.     value to make the objects/animation "jump" ahead and  skip  frames.   the
  233.     slower the computer or the greater number of objects  there  are  on  the
  234.     screen, the higher the value  traces_past  will  be  after  updating  the
  235.     screen.  Therefore, if you write your own game/animation, use this  value
  236.     to determine how fast the game should go - the IRQ is timed to match  the
  237.     vertical retrace so every time one passes by, traces_past gets +1. I have
  238.     two interrupts - a protected mode IRQ and a real mode IRQ. I did it  this
  239.     way so that if you want to add music or whatever, you can use either type
  240.     of IRQ.  Both add 1 to traces_past.  Also, I have timed  the  IRQ  to  be
  241.     close to the vertical retrace time but I don't know if  I  have  done  it
  242.     correctly.  If you notice that the out dx,al is not the way to  go  about
  243.     it, drop me a line with the correct method of  setting  the  8253  timer.
  244.     The value of traces_past will be from 1 to whatever (never 0 after trace)
  245.     Note: Version 2.6, problem fixed.
  246.  
  247.     I also fixed a small bug in the updvectors routine - which is now  called
  248.     updvectors2, called by "updvectors".
  249.  
  250.     I have also had a back operation to fix that herniated disc  and  am  now
  251.     sitting upright at my computer.  So I have this message for you:  Sit  up
  252.     straight at all occasions, bend from the knees, get two  people  to  lift
  253.     a heavy object, don't be macho,stand straight at all times,walk straight,
  254.     don't slouch when driving, don't over excercise, don't prop your head  up
  255.     with your arm when watching TV, (put adjective here) straight.  TAKE CARE
  256.     OF YOUR AMAZING MOTION MACHINE - YOUR BACK.   Learn  the  easy  way  from
  257.     someone who learnt the hard way - we're not invincible. STRAIGHT STRAIGHT
  258.     STRAIGHT! STRAIGHT! STRAIGHT! STRAIGHT! There, I'm done.
  259.  
  260.   Some bugs fixed for 2.5:
  261.  
  262.     Fixed the timer IRQ to have OUT 43h,AL (You'll never know the  difference
  263.     but I thought it would be a nice gesture)
  264.  
  265.     I have also ripped a routine from someplace else  to  time  the  vertical
  266.     retrace and set the irq to this value.  This replaces the static variable
  267.     with a more accurate calculation for each computer's irq timing.
  268.  
  269.     I also added a total retrace counter called "frame_number"  which  counts
  270.     from the begining of any animation so you can, let's say at  2.5  minutes
  271.     into it, perform a certain function.  The  counter  is  only  reset  when
  272.     reset_raster_count is called (begining of new animation sequence).
  273.  
  274.     I have also changed the math routine setsincose so that if  you  are  not
  275.     using z rotations, you won't need to reset eyeaz to 0.  (Can be anything)
  276.     This really doesn't increase speed much though.
  277.  
  278.     I optimized some of the imuls with a pre-calculated table. Just to remind
  279.     you:  Changing  video  modes  can occure within the program, but you  can
  280.     only change the vertical size, not the horizontal size (eg  swap  between
  281.     320x400 mode and 320x200 mode, or 360x480 mode   and  360x240  mode)  You
  282.     would only need to adjust the clipping limits and the make3d constants to
  283.     change modes while the program is  executing.   Re-assembley   would   be
  284.     required if you wanted to change into a different x-width mode.
  285.  
  286.     Fixed the xmouse.asm routine plot_mouse.  It was  not  using  an  earlier
  287.     xmode bitmap change.
  288.  
  289.     Robert Johnston now has the correct spelling to his name.
  290.  
  291.     By the way, the mouse is supposed to look like  that!   Call   plot_mouse
  292.     without any page flipping if you want a regular mouse that remembers what
  293.     is behind it.
  294.  
  295.   Version 2.6 doesnt exist anymore:
  296.  
  297.   Additional .asm files for 2.7:
  298.  
  299.     A file has been added to put stars in  the  background.   Stars.asm  only
  300.     calculates the positions of stars that will be on or close to the screen.
  301.     The routine has two assembley modes - full stars or half stars.  The half
  302.     stars mode plots stars that are above the 0y axis.  This allows  you   to
  303.     have a flat surface (airfield/horizon) without calculating the  positions
  304.     of stars below the screen.  The routine is called show_stars.
  305.  
  306.     I have added a macro to the file macros.inc to multiply  by  a  constant.
  307.     The macro is used as cmul result, value, constant.  eg  cmul eax,ecx,320.
  308.     Only  some values are supported but this will change  as  more  constants
  309.     are required.  This replaces a few lines of code in the  make3d  routines
  310.     so ratiox and ratioy imul's can be used by the user (you) without  having
  311.     to import the code from math.inc.  I  also  fixed  a  tini-eeni-wini  bug
  312.     in the non-fast imul routine - not that you care or anything...
  313.  
  314.     God, I can't wait to get a 586...
  315.  
  316.     I have also solved (?) the problem with files>64k not working,I have made
  317.     all 16 bit indexes to 32 bit indexes. The only remaining problem/drawback
  318.     is that the linking order must be such that the irq assembley follows the
  319.     protected mode header, eg: TLINK /3 pmode irq xx xxx xx xx.  I don't know
  320.     why the irq stuff doesn't work if is in the>64k block, maybe  because  it
  321.     has 16 bit real mode code in it or something, who knows...Just link it as
  322.     I have and you can do anything else you want in the 32 bit code  segment.
  323.  
  324.     Because of  the  above,  I  have  moved  the  variables  traces_past  and
  325.     frame_number from 3d.asm to irq.asm. If you need the computer speed/frame
  326.     speed, you will have to have irq.inc in your assembley.  Don't  look  for
  327.     these variables in vars1.inc or vars2.inc anymore, they have  been  moved
  328.     to irq.asm.
  329.  
  330.     Removed more common routines from 3d1 and 3d2 and put them in poly.inc.
  331.  
  332.     John says hi to Sebastian...
  333.  
  334.   Optimizations for 2.8:
  335.  
  336.     Stars routine runs a tad faster.
  337.  
  338.   Additions for 2.9: Sept 28,'93
  339.  
  340.     I just had a brainstorm on how to calculate the 3d stars considering  the
  341.     stars  are  at  a  constant  distance  from  the  camera.   The  variable
  342.     perfect_stars has been added to allow the stars routine to calculate  non
  343.     perfect 3d stars. This makes the routine much faster, while it  basically
  344.     looks the same.  This is  possible  since  the  stars  are  always  at  a
  345.     constant distance from the camera.
  346.  
  347.     I've also added more macros to the cmul macro.  That  is,  more  multiply
  348.     by constant macros...
  349.  
  350.     Ok people, how come I haven't gotton any postcards yet?  Does nobody read
  351.     this code?  Like, it only cost's 50 some odd cents for a stamp.   I mean,
  352.     tell me what the weather is like where you are, or  something  about  the
  353.     local news events.
  354.  
  355.   Additions for 2.A (hex): Oct 1, '93
  356.  
  357.     Variables xxxfinal[] have been added to the movement/rotate  routines  to
  358.     ensure correct final placement of an object.  This was necessary  due  to
  359.     errors when multiple additions of speed*time did  not  equal  the  actual
  360.     requested final position.  So, every  time  you change  the  anglular  or
  361.     linear velocity, the  variables  final  position  must  be  set  to  tell
  362.     updvectors where that final position is.  If you do not want to calculate
  363.     the final positions yourself, two routines have been supplied  to  do  it
  364.     for you: set_finall - for linear calculations, and set_finala for angular
  365.     calculations.  But remember, if you have no intention of ever letting the
  366.     object come to rest, you dont need to set finall or finala.   These  must
  367.     only be set if you are going to move an object from point a  to  point  b
  368.     and let it stay at point b - (without moving  it  again  before  it  ever
  369.     reaches point b).
  370.  
  371.     Added a routine  called  twist_si.   This  sets  the  objects  rotational
  372.     velocity based on a 32 bit input.  Similar to move_si routine.
  373.  
  374.     When  using  twist_si  or  move_si,  try  to   keep   the   time   small.
  375.     eg: <1000 frames.  this will prevent a "jump"  when  the  object  finally
  376.     stops moving/rotating.  if you want large time constants, call set_finall
  377.     or set_finala after calling move_si or twist_si respectivly.   This  will
  378.     re-calculate the final position based on large  time/decimal  error  loss
  379.     and prevent the object from "jumping" at the  end  of  it's  cycle/count.
  380.     OR: call move_si or twist_si in sections, eg call it first as  you  would
  381.     normally (with correct time/distance/angles loaded)  then,  half  way  to
  382.     it's destination, call the routine again (with time/2).  This will re-cal
  383.     the speed better and will also prevent that "jump". (Did you get that?)
  384.  
  385.     We will note that my number (as of Oct 4) gets changed to  the  905  area
  386.     code - (905) 831-1944.
  387.  
  388.     Some routines  added - Point_it,  points object si at  object  di.   This
  389.     only affects the x and y angles, the z angle can still provide spin.
  390.  
  391.     Point_to points object si to location ebx,ecx,ebp
  392.  
  393.     Point_dir routine points object si in the direction it is moving.
  394.  
  395.     Set_speed routine does the opposite of the above routine.   It  sets  the
  396.     speed of the object to the  direction  it  is  pointing.   si  =  object,
  397.     ebp = speed, di = lcount.  (lcount = linear counter, object stops when 0)
  398.  
  399.     Point_time routine points object si to ebx,ecx,ebp in di frames
  400.  
  401.     I managed to get my Suzuki GS1150 up to 240km/hr on the 401 today...
  402.  
  403.   Features added to 2.B: Oct 6, '93
  404.  
  405.     Shading like the pro's:  (Wait a minute, isn't that me?)
  406.  
  407.     Routines added:
  408.  
  409.     pre_cal_lambert   - scan object si and calculate surface normals
  410.     calc_normal       - from 3 points, returns normal vector ebx,ecx,ebp
  411.     lambert           - calculate surface normal rotation maxtrix for object si
  412.     set_up_all_lambert- scans objects from si to di and calls pre_cal_lambert
  413.     lrotate.          - given normal for surface, figures out intensity
  414.  
  415.     I finally bought a book on assembley language today.   God,  there's  all
  416.     kinds of stuff I didn't know this computer can do.  Like xlat...bt...
  417.  
  418.     I've included some old screen set up routines - font.asm and font?.inc
  419.     There not really font routines, just screen setup routines.
  420.  
  421.     Also made the vector sort a little more accurate.
  422.  
  423.   Many, many, many additions for 3.0: Nov 19, '93
  424.  
  425.     THE OBJECT FORMAT HAS BEEN CHANGED!  Changes include addition of 25  words
  426.     at the beginning of the object to accomodate future revisions. But the big
  427.     change is that all points are now point+1.  eg what used to be 0,1,2,0  is
  428.     now 1,2,3,1.  This gives the user access to point 0, which is the  objects
  429.     center of gravity. (point 0,0,0).  The new format for  surface  definition
  430.     is:
  431.  
  432.      dw commands, texture1,texture2,colour1,colour2, connections, [0,0,0]
  433.  
  434.      where the commands determine what the  surface  is,  eg:polygon,  texture,
  435.      bitmap, point, line, along with the  visibility  and  iteration  commands.
  436.      While texture1 and color1 determine what the polygon will look like on the
  437.      first side, txt2 and col2 determine what the other side will look like.
  438.  
  439.     Some optimizations in math.inc (thanks to my new assembler book, Oooo...)
  440.  
  441.     I finally found out how to make a MAKE file.
  442.  
  443.     We will notice my internet access has been corrected.
  444.  
  445.     Optimized/fixed the calc_angles routine (not that you'll care or anything)
  446.  
  447.     Iterations added to objects.  Now object surfaces can have surfaces within
  448.     surfaces within surfaces within surfaces...Example: a building has a  main
  449.     wall with many windows on it, on the windows there is a sign, on the  sign
  450.     there is a bug - if the sign isn't visible, don't plot the bug  -  if  the
  451.     window isn't visible, dont plot the sign (or the bug) - if the  main  wall
  452.     isn't visible, don't plot anything.  This allows objects to be  very  very
  453.     detailed without wasting CPU time.  Iterations save MEGA cpu time!!!
  454.  
  455.     Another sort method has been added - 3d3.asm.  This method uses parts from
  456.     both 3d1.asm and 3d2.asm.  How it  works  -  the  objects  are  sorted  as
  457.     individual objects  until  they  become  close  to  one  another  (set  by
  458.     collision tolerence value) then they get sorted as one object. This allows
  459.     objects to go through one another (and  still  be  sorted  correctly)  yet
  460.     avoids the CPU intensive sorting of hundreds of sides.   If  you  set  the
  461.     tolerence value to 0, the code will run just like 3d1.asm, if you  set  it
  462.     to 1billionx, the code will run like 3d2.asm - somewhere in the middle the
  463.     two sort methods mix.  (Note: 3d1.asm is still the fastest)
  464.  
  465.     A routine has been added to allow the user to scan a file for a "[MARKER]"
  466.     or magic word.  The _findmarker routine scans a file and returns an offset
  467.     (32 bit) in the file as to where the marker was found.  This can  be  used
  468.     to load in mods/gifs and data from the  end  of  the  program  instead  of
  469.     having a seperate data file(s).  This method is similar to the method used
  470.     in demos like UNREAL.EXE and CD2.EXE.  It could also be used to store data
  471.     in or modify the original program. This is not really related to 3d vector
  472.     programming though.
  473.  
  474.     Relative surface colour option can use the  intensity  from  the  previous
  475.     surface.  This relieves the CPU from performing repetative surface  normal
  476.     calculations.  Eg: set the first surface to gourad/lambert shading and set
  477.     all other surfaces with the same normal (angle) to use this intensity. The
  478.     object command to use the previous surface colour is  called  "last".  See
  479.     objects.inc or equ.inc.
  480.  
  481.     Another method for testing if a side is visible has been implemented. Now,
  482.     as well the surface being counter-clockwise, you can also test if  all the
  483.     points are on the screen.  This can be either combined  with  the  counter
  484.     clockwise test or used on it's own.  I don't what good it is yet though...
  485.     Maybe  useful  when  combined  with  iterations?   The  test  works   even
  486.     if a large polygon covers the screen (like the side of a large building)
  487.  
  488.     I have now made 3d1,3d2 and 3d3 all use the same animation format: eg call
  489.     init_tables before an animation then call makeobjs during  the  animation.
  490.     This is the same method for all 3 sorting types.  Although these  routines
  491.     call  different  routines  in  each file, they all end up doing  the  same
  492.     thing.
  493.  
  494.     I actually found a bug in this thing! (yes one little  bug)  -  fixed  the
  495.     arctan function.
  496.  
  497.     Extraced the clipped_line routine so you can use it anywhere. Clipped_line
  498.     routine draws from dx,cx to ax,bx colour bp, but does  it  with  cartesian
  499.     cords - eg 0,0 is screen center,also updates clearing width/height if used
  500.     and clips to borders (of course).
  501.  
  502.     Palette cross referencing option added for each object.  Lets  say  you've
  503.     got 6 spaceships on the screen but you want them each to have a  different
  504.     colour scheme.  Set the offset dword of [palxref]  to  point  to  a  cross
  505.     reference palette.  This way, many on-screen  objects  can  use  the  same
  506.     shape data but each can have a different colour scheme.
  507.  
  508.     I got my 486DX66 today...(Friday Nov 5/93)
  509.  
  510.     Due to popular demand, the camera is now the zero'th  object!!  Therefore,
  511.     all of your objects start a location 1 (1 = 1st object, 2 = 2nd object...)
  512.     The old way had the camera as the last object.  So,  to  move  the  camera
  513.     to location x,y,z in di frames: load up ebx,ecx,ebp as location to move to
  514.     load di with time to get there, load si  =  0  (cameraobject=0)  and  call
  515.     move_si.
  516.  
  517.     The vector matricies have been truncated to 16  bits  from  32  bits.  The
  518.     accuracy of the code however, remains the same as before.  Note: Jan 8th,
  519.     Matricies have been pumped back up to 32 bit!!
  520.  
  521.     Small, tini-weeni bug fixed in polyfill.  I am no longer using  doubleword
  522.     transfers to the VGA.  This  should  stop  people  having  their  monitors
  523.     destroyed - (just kidding)  It removes those eggs.
  524.  
  525.     And yet another option! 1/4 scaled fuzzy bitmaps (for  lack  of  a  better
  526.     name). These are scalable, non-rotatable bitmaps just like the ones you've
  527.     seen before (option 32) but only every 4'th pixel is  sampled.   This  has
  528.     the advantage of faster plotting of bitmaps that don't require  a  lot  of
  529.     accuracy - like explosions and smoke.  To invoke this new type of  bitmap,
  530.     just use option 33 (32+1) in either the object definition or in userotate.
  531.     (note: if used in object, bitmap is part of object. if used in  userotate,
  532.     entire object is one big bitmap - like I said, good for explosions)
  533.  
  534.     Holly Kamolly, this thing is getting big...
  535.  
  536.     All surface/polygon options have now been set to defines.  Look in the equ
  537.     file to see what options there are.  This now replaces using 512+256+2+...
  538.     in your object.  (makes understanding them easier)  The new defines are:
  539.  
  540.     excerpt from equ.inc: current list of commands and texture options
  541.  
  542.       ; texture options (texture1&2)
  543.       wavey    equ 1       ; sine wave surface
  544.       shade    equ 2       ; lambert shaded surface
  545.       inverse  equ 4       ; inverse shading
  546.       glow     equ shade+inverse
  547.       last     equ 8       ; colour is same intensity as previous surface
  548.       texture  equ 16      ; texture mapped surface
  549.       mesh     equ 32      ; mesh style polygons
  550.  
  551.       ; surface types   (command)
  552.       point    equ 32      ; surface is a point
  553.       line     equ 64      ; surface is a line
  554.       himap    equ 128     ; scalable, non-rotatable, hi quality bitmap
  555.       lomap    equ himap+1 ; scalable, non-rotatable, lo quality bitmap
  556.  
  557.       ; surface commands(command)
  558.       iterate  equ 256     ; generate iteration below if side visible
  559.  
  560.       ; visibility determination methods (command)
  561.       both     equ 1       ; always visible, no matter side
  562.       double   equ 2       ; double sided surface, other side has texture2 and colour2
  563.       onscr    equ 4       ; is polygon on screen?
  564.       check    equ 8       ; check if polygon is on screen/counter-clockwise, but don't plot
  565.  
  566.      to be used in the format:
  567.  
  568.      dw commands,texture1,texture2,colour1,colour2, connections, [0,0,0]
  569.  
  570.    Dont trust the above list as gospel, look in the file equ.inc to make sure
  571.    your using them correcly.  Revisions will show up in equ.inc but they  may
  572.    not make it to this list.
  573.  
  574.    The objects now have user-definable resolutions.  Look at the objects.inc
  575.    file to see how I have implemented this.  The first dd is the  resolution
  576.    at which the next offset  is  visible  at.   Successive  resolutions  are
  577.    visible  at farther distances.  The only object I have  implemented  with
  578.    a different resolution is that bitmapped cube thingy.  Notice as it  gets
  579.    farther away, the chrome balls turn into single pixels.   The  end  flag
  580.    for "this is the last resolution" is -1.
  581.  
  582.   Additions for 3.5 - Feb 1/94
  583.  
  584.     Joystick routines added - see joystick.asm.
  585.  
  586.     It is now possible to have sub-objects part of main  objects.   Note  that
  587.     this is different from the iterations. Iterations are  sub-surfaces,  sub-
  588.     objects are things like turrets on tanks, radar dishes on spaceships.  The
  589.     sub-object is defined so that your code can alter the angle of the sub-obj
  590.     without   having  to  calculate  the  resulting  rotation/offset  of  that
  591.     sub-object.  Eg:  All you will have to do to make a radar dish on a  space
  592.     ship and  rotate  the  y  value - the resulting angle (because  the  space
  593.     ship itself will be rotating) is automatically calculated for  you.   This
  594.     way, you don't have to worry about compounding rotational  matricies,  the
  595.     program does it for you.  Look in objects.inc for an  example  of  how  to
  596.     make an object  with  a  sub-object  attached.   There  you  will  find  a
  597.     Rectangle with two sub-objects attached.  (This would be really  neet  for
  598.     making a robot eh!!)
  599.  
  600.     If you were having trouble with point_time or twist_si, I found a bug with
  601.     the sign extending of the rotation - These routines now work fine.
  602.  
  603.     Due to my poor memory, (not the computers memory, my memory)  I  have  now
  604.     commented the routines.  Heck, even I was forgetting how to use them.
  605.  
  606.     I promised PCX decoding  for  3.1   but  I've  found  that  the  LZW  .GIF
  607.     compression is much tighter than PCX. I will have to attribute the LOADGIF
  608.     routine to Rich Geldreich.  I simply took his QBasic routine and converted
  609.     it to protected mode assembley.  I guess it could be optimized -  but  who
  610.     really cares?
  611.  
  612.     In a fit of optimization, I have modified most words to doublewords.  This
  613.     is after the realization that in protected mode, mov ax,bx is slower  than
  614.     mov eax,ebx.  Most shr ax,1 have been changed  to  shr  eax,1.  Most  word
  615.     labels have been changed to doubleword lables - not all, but most.
  616.  
  617.     The irq can now have user-definable subroutines.  Just set _irqcontrol0 to
  618.     the offset of the routine you want to be called every 1/70'th of a second.
  619.     This is only available if you have the protected mode IRQ running.   There
  620.     are 3 (count 'em, three!) possible IRQ subroutine controls.  To disable  a
  621.     IRQ subroutine, set the offset to offset _ret.
  622.  
  623.     A practical example of the IRQ subroutine  thingy  is  shown  in more.inc.
  624.     In this file you  should  find  the  new  IRQ  controlled  palette  fading
  625.     routines.
  626.  
  627.     The latest options!: GOSUB, RETURN, GOTO_OFFSET.   These  obscure  options
  628.     can be used in the object data definition  to  re-direct  the  loading  of
  629.     surface data and to prevent multiple copies of data.  I have no  idea  why
  630.     you would want this function or where you could use this, but you  let  me
  631.     know if this is usable.  I just kinda got bored one day...
  632.  
  633.     Another great option is the non-fiaxble semi glocos and there fort basm at
  634.     40 pixels per screen width blah blah blah. Just testing to see  if  anyone
  635.     actually reads this stuff.  Gotcha.
  636.  
  637.     Someone told me that 16 colours per shading table was not enough,  so  the
  638.     QBASIC program SHADING.BAS has been modifed to allow the user to  generate
  639.     custom shading tables to any length.  The palette can now be utilized  for
  640.     32 colours per shaded surface, or 48, or 64 or whatever  you  want.   Even
  641.     odd shading table sizes could be used like 41 or 23. (Like, who would  use
  642.     that..?)  Right now, I have it set to 16 colours per lambert shade -  this
  643.     gives me 16 colours per side with a total of 16 different colours (256/16)
  644.     Changing it to 32 colours per side would leave you with 8  total  colours.
  645.     You get the idea right?  Be careful when mixing odd  shading  table  sizes
  646.     with the "LAST" texture command.  The "LAST" command uses the intensity of
  647.     the last surface and it wont work with non 2's complement  shading   table
  648.     sizes.  (If you dont get that, just set the table sizes to 16,32,64,128..)
  649.  
  650.     The Twist_si routine has been fixed so sign  extended  rotation  now works
  651.     perfectly - not that anyone cares...
  652.  
  653.   Version 3.6: May 31/94
  654.  
  655.     The animation routine "animate_this" now uses a user-definable subroutine
  656.     for screen updating - this is so each animation in a demo/game  can  have
  657.     a different background or include stars or not, what ever the user wants.
  658.  
  659.     Mark Rosteck now has correct spelling to his name
  660.  
  661.     Another small bug was found and squashed.  LROTATE no longer goes out  of
  662.     range.
  663.  
  664.     Auto Shading Intensity option has been added.  Now, if you want an object
  665.     to appear as if it has lambert-normal shading to it, but  you  dont  care
  666.     if the surfaces change color as it rotates, you can use this  option  and
  667.     the pre-calculation routines will calculate "what intensity  should  this
  668.     surface be at".  This is really good for objects that are  on the  ground
  669.     and will never be rotated, but you want them to have the appearance of  a
  670.     light source.
  671.  
  672.     The big addition to 3.6 is the conversion program to  convert  DXF  to  a
  673.     workable 3dvector format.  There are tonnes (metric) of  options  so  you
  674.     should really check it out - DXF23DV2.ZIP (It can also convert PLG's)
  675.  
  676.     All include files (*.inc) that define external routines  (eg _gopth:near)
  677.     have been renamed to *.ext to avoid confusion over routines and externals
  678.  
  679.     John McCarthy would like to  say  HI!  to  those  people  who  have  sent
  680.     postcards, just to name a few:
  681.  
  682.       Cata Lee (also Ted)  - Romania
  683.       Peter Hinz           - South Africa
  684.       Ivan Scheers         - Belgium
  685.       Laurent Passebecq    - France
  686.       Tony Tod             - South Wales
  687.       Nicholas Christopher - Ottawa
  688.  
  689.       Everbody from around the US! ..and also to that guy from Brazil (I
  690.       forget your name)  And Hi to that guy from  Alberta  whose  school
  691.       burnt down! (did they rebuild it yet?)   And  Hi  to  the  guy  in
  692.       Austin. TX. with the Startrek game!
  693.  
  694.       There are many more and many more who called but I dont have names
  695.       for all - Hi to all of you also.
  696.  
  697.     Does anyone have a mod to 669 converter?  I really really need one...
  698.  
  699.     Or does anyone have MIDI .PAT file player in protected mode assembley for
  700.     the GUS?  (simple request eh?)
  701.  
  702.   Version 3.7:  June 22/94  (My mothers birthday today!)
  703.  
  704.     The stars routine has been optimized even more! (Oooo,wow)
  705.  
  706.     A new surface type called MESH.  Guess.  Its that  screen  door  type  of
  707.     thingy I saw in REND386 (ug).  Use it, you'll see what its like.
  708.  
  709.     XY screen tolerancing is now part of the 25  words  in  the  object.  See
  710.     objects.inc for explanation.
  711.  
  712.     Glenz vectors are now possible with  the  "glenz"  texture  option.   The
  713.     colour of the surface refers to a cross referanced palette from which the
  714.     glenz polygon will derive it's new colours.  Put  the  cross  referancing
  715.     palette offset into xreftable and make the colour index  the  palette  in
  716.     the table.  As of this writing, I have no good cross referancing palettes
  717.     and therefore the glenz vector table I have looks kind of crappy.   Maybe
  718.     I will write a program to generate the glenz tables someday.
  719.  
  720.     Another great option!  Stone textures.  I looked at Alone In The Dark and
  721.     really liked the texture on the stones/walls. This texture is implemented
  722.     by simply adding the term "stone" to  the  texture  type.   This  is  NOT
  723.     texture mapping (yet).  But it is fast and I think it  looks  neat.   The
  724.     Qbasic program stone.bas allows you to make new stone textures.  You must
  725.     point the table "stonetbl" to the stone texture you  want  to  use.   The
  726.     colour for the surface refers the the  type  of  stone  texture  to  use.
  727.     Therefore, you can combine this option with the  shade  option  and  have
  728.     shaded stone textures.  All you have to do is make  16  different  shaded
  729.     stone include files.  (As I have done in the examples).  The stone option
  730.     kind of rolls around on the screen, but I still like it anyway.
  731.  
  732.     More 32bit optimization has been done.  Trust me.
  733.  
  734.  
  735.  
  736.  
  737.  
  738.     -------------------------------------------------------------------------
  739.  
  740.     If anyone has ideas for games, projects, and would like to put together a
  741.     team to produce commercial games/products, drop me a line and  we'll  get
  742.     started - We need graphics artists,  musicians,  programmers  (assembley,
  743.     protected mode are best, C real mode will do fine) and ideas,ideas,ideas!
  744.  
  745.     -------------------------------------------------------------------------
  746.  
  747.